package net.caidingke.shepherd.domain.user;

import io.ebean.annotation.Cache;
import io.ebean.annotation.Index;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import net.caidingke.shepherd.domain.BaseModel;
import net.caidingke.shepherd.domain.user.finder.RolePermissionFinder;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * 角色权限
 *
 * @author bowen
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@Cache
public class RolePermission extends BaseModel {

    public static final RolePermissionFinder F = new RolePermissionFinder();

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Index
    private Long roleId;

    @Index
    private Long permissionId;
}

